package com.office.mapper;

import com.office.config.aop.DataSource;
import com.office.dataobject.BusinessOrange;
import com.office.dataobject.BusinessOrangeExample;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface BusinessOrangeMapper {
    @DataSource("slave1")
    long countByExample(BusinessOrangeExample example);

    @DataSource
    int deleteByExample(BusinessOrangeExample example);

    @DataSource
    int deleteByPrimaryKey(Integer id);

    @DataSource
    int insertBatch(List<BusinessOrange> records);

    @DataSource
    int insert(BusinessOrange record);

    @DataSource
    int insertSelective(BusinessOrange record);

    @DataSource("slave1")
    BusinessOrange selectOneByExample(BusinessOrangeExample example);

    @DataSource("slave1")
    List<BusinessOrange> selectByExamplePaging(@Param("example") BusinessOrangeExample example, @Param("offset") int offset, @Param("limit") int limit);

    @DataSource("slave1")
    List<BusinessOrange> selectByExample(BusinessOrangeExample example);

    @DataSource("slave2")
    BusinessOrange selectByPrimaryKey(Integer id);

    @DataSource
    int updateByExampleSelective(@Param("record") BusinessOrange record, @Param("example") BusinessOrangeExample example);

    @DataSource
    int updateByExample(@Param("record") BusinessOrange record, @Param("example") BusinessOrangeExample example);

    @DataSource
    int updateByPrimaryKeySelective(BusinessOrange record);

    @DataSource
    int updateByPrimaryKey(BusinessOrange record);
}